package com.example.rabbit.user;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserSender
{
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendToMq()
    {
        User user = new User("XXXX","OOOO");
        System.out.println("UserSender1 : " + user);
        this.amqpTemplate.convertAndSend("user", user);
    }
}
